Skip to content

[single] Refactor: Replace busy waiting with a condition variable in close#666

Merged
myungjoo merged 1 commit intonnstreamer:mainfrom
songgot:remove_g_usleep
Dec 5, 2025
Merged

[single] Refactor: Replace busy waiting with a condition variable in close#666
myungjoo merged 1 commit intonnstreamer:mainfrom
songgot:remove_g_usleep

Conversation

@songgot
Copy link
Copy Markdown
Contributor

@songgot songgot commented Nov 26, 2025

Replaced the busy waiting loop (g_usleep) in ml_single_close with g_cond_wait to improve CPU efficiency.

  • Modified to broadcast a signal immediately after completing an invoke tasek.
  • Updated to wait on the condition variable instead of polling the invoking state every 1ms.

@songgot songgot force-pushed the remove_g_usleep branch 3 times, most recently from 71fbff2 to fa75cbf Compare November 27, 2025 01:59
Comment thread c/src/ml-api-inference-single.c Outdated
…close

Replaced the busy waiting loop (g_usleep) in ml_single_close with `g_cond_wait`
to improve CPU efficiency.
- Modified to broadcast a signal immediately after completing an invoke tasek.
- Updated to wait on the condition variable instead of polling the `invoking`
  state every 1ms.

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
@myungjoo myungjoo merged commit 472be75 into nnstreamer:main Dec 5, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants